--
-- Created by IntelliJ IDEA.
-- User: haven
-- Date: 2019/12/9
-- Time: 18:56
-- To change this template use File | Settings | File Templates.
--

local key = KEYS[1]
local expireTime = tonumber(ARGV[1])

local ret = redis.call("setnx", key, 1);
if (ret == 1) then
    redis.call("expire", key, expireTime);
end

return ret == 1;
